package com.taotao.portal.service;

import com.taotao.common.TaotaoResult;
import com.taotao.portal.pojo.CartItem;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface CartService {
    /**
     * 添加购物车
     * @param itemId
     * @param request
     * @param response
     * @return
     */
    List<CartItem> add(Long itemId, HttpServletRequest request, HttpServletResponse response);

    /**
     * 获取购物车中商品列表
     * @param request
     * @return
     */
    List<CartItem> getCartList(HttpServletRequest request);

    /**
     * 删除购物车中的商品
     * @param itemId
     * @param request
     * @param response
     * @return
     */
    List<CartItem> deleteCart(Long itemId, HttpServletRequest request, HttpServletResponse response);

    /**
     * 修改指定商品的数量
     * @param itemId
     * @param num
     * @param request
     * @param response
     * @return
     */
    TaotaoResult changeCartItemNum(Long itemId, Integer num, HttpServletRequest request, HttpServletResponse response);
}
